package net.kangyee.eventmanager.commands;

import org.bukkit.entity.Player;

import net.kangyee.eventmanager.EventManager;

public class CmdList extends EventManagerCommand {
	
	private EventManager plugin;
	
	public CmdList(EventManager plugin){
		this.plugin = plugin;
	}

	public void onCommand(Player player, String[] args){
		String str = "";
		player.sendMessage("§f[§6活动管理 - 参加活动的玩家名单§f]");
		for(Player localPlayer : plugin.regPlayers.keySet()){	
			str += localPlayer.getDisplayName() + ", ";
		}
    	if (str == "") str = "暂无玩家报名参加";
    	player.sendMessage(str.substring(0,str.length() - 2));
		return;
	}

	public String getCmdName(){
		return "list";
	}

	public String getArgs(){
		return "";
	}
	
	public int getMaxArgs(){
		return 1;
	}

	public int getMinArgs(){
		return 1;
	}

	public String getPermission(){
		return "eventmanager.player." + getCmdName();
	}

	public boolean getStateRequire(){
		return true;
	}
	
	public boolean getRegPCRequire() {
		return false;
	}
}
